package club.hicode.daydayup.threadlocal;

import org.junit.Test;

import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * 测试
 *
 * @author Liu Chunfu
 * @date 2018-05-29 下午8:28
 **/
public class MyStaic {

    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            try {
                TimeUnit.SECONDS.sleep(3);
                System.out.println(123);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().isDaemon());
        });
        thread.start();
        System.out.println("Hello:" + Thread.currentThread().isDaemon());
    }

    @Test
    public void thread1() throws InterruptedException {
        Thread thread2 = new Thread(() -> {
            try {
                TimeUnit.SECONDS.sleep(3);
                System.out.println(123);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().isDaemon());
        });
        thread2.start();

        System.out.println("hello:" + Thread.currentThread().isDaemon());
    }

    @Test
    public void test3() {

        Stream<Integer> boxed = IntStream.range(1, 4).boxed();
        IntStream range = IntStream.range(1, 4);

    }
}
